test: add fuzz tests for subscriber GraphQL data marshaling#5534
Open
wingwogus wants to merge 4 commits into
Open
test: add fuzz tests for subscriber GraphQL data marshaling#5534wingwogus wants to merge 4 commits into
wingwogus wants to merge 4 commits into
Conversation
Signed-off-by: 이재현 <wingwogus@naver.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds targeted Go fuzz coverage for MarshalGQLData in the subscriber GraphQL package to harden marshaling/quoting behavior across a wide range of input strings and to assert expected failures for known-unsupported JSON values.
Changes:
- Add
FuzzMarshalGQLDatato fuzz JSON-marshalable subscriber payloads and validate the returned payload is safely quoted/unquotable. - Add a negative unit test to ensure marshal errors are returned for unsupported inputs (function values,
NaN,Inf). - Introduce a small helper (
assertValidQuotedPayload) to centralize output validation checks.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
Hey @wingwogus |
Signed-off-by: 이재현 <wingwogus@naver.com>
Contributor
Author
|
@PriteshKiri I checked the Copilot review comments and updated the test helper to include U+2028 and U+2029 in the raw line terminator check. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Fixes: #5532
This PR adds focused fuzz coverage for
MarshalGQLDatainchaoscenter/subscriber/pkg/graphql.The fuzz test validates that JSON-marshalable subscriber payloads are processed without unexpected errors and that the returned GraphQL payload is safely quoted, contains no raw line terminators, and can be unquoted successfully. It also adds negative coverage for unsupported marshal inputs such as function values,
NaN, andInf.Types of changes
Checklist
Dependency
None.
Special notes for your reviewer
Verified locally with: